home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
util
/
wb
/
ider.lha
/
Routines
/
Routines.s
< prev
next >
Wrap
Text File
|
1997-02-18
|
1KB
|
60 lines
FindData: Movem.L A2/A3,-(SP) ; ### Standard FindData() routine ###
.FindDataLoop Moveq #0,D0
Moveq #0,D1
Move.B (A0),D0
Bsr.S ChangeCase
Move.B D0,D1
Move.B (A1)+,D0
Tst.B D0
Beq.S .Exit
Bsr.S ChangeCase
Cmp.B D0,D1
Bne.S .FindDataLoop
Lea 1(A0),A2
Move.L A1,A3
.findloop Move.B (A2)+,D0
Tst.B D0
Beq.S .Found
Bsr.S ChangeCase
Move.B D0,D1
Move.B (A3)+,D0
Bsr.S ChangeCase
Cmp.B D0,D1
Bne.S .FindDataLoop
Bra.S .findloop
.Exit Moveq #-1,D0
Movem.L (SP)+,A2/A3
Rts
.Found Lea -1(A1),A0
Move.L A3,A1
Moveq #0,D0
Movem.L (SP)+,A2/A3
Rts
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ChangeCase: Cmp.B #'a',D0 ; ### Standard convert to UpperCase() routine ###
Blo.S .exit
Cmp.B #'z',D0
Bls.S .change
Cmp.B #$E0,D0
Blo.S .exit
Cmp.B #$FD,D0
Bhi.S .exit
Cmp.B #$F7,D0
Beq.S .exit
.change Sub.B #32,D0
.exit Rts
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
StripQuotes: Move.B (A0)+,D0 ;copies a string
Cmp.B #'"',D0 ;while removing any "'s it may find
Beq.S StripQuotes
Move.B D0,(A1)+
Bne.S StripQuotes
Rts